blob: 7592581c367a2d61c8950f7e9d2a5e674044a59a [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Junio C Hamanoba4b9282008-07-06 05:20:316<meta name="generator" content="AsciiDoc 8.2.5" />
Junio C Hamano1a4e8412005-12-27 08:17:237<style type="text/css">
8/* Debug borders */
9p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
10/*
11 border: 1px solid red;
12*/
13}
14
15body {
16 margin: 1em 5% 1em 5%;
17}
18
Junio C Hamanoba4b9282008-07-06 05:20:3119a {
20 color: blue;
21 text-decoration: underline;
22}
23a:visited {
24 color: fuchsia;
25}
Junio C Hamano1a4e8412005-12-27 08:17:2326
27em {
28 font-style: italic;
29}
30
31strong {
32 font-weight: bold;
33}
34
35tt {
36 color: navy;
37}
38
39h1, h2, h3, h4, h5, h6 {
40 color: #527bbd;
41 font-family: sans-serif;
42 margin-top: 1.2em;
43 margin-bottom: 0.5em;
44 line-height: 1.3;
45}
46
Junio C Hamanoba4b9282008-07-06 05:20:3147h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2348 border-bottom: 2px solid silver;
49}
50h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2351 padding-top: 0.5em;
52}
Junio C Hamanoba4b9282008-07-06 05:20:3153h3 {
54 float: left;
55}
56h3 + * {
57 clear: left;
58}
Junio C Hamano1a4e8412005-12-27 08:17:2359
60div.sectionbody {
61 font-family: serif;
62 margin-left: 0;
63}
64
65hr {
66 border: 1px solid silver;
67}
68
69p {
70 margin-top: 0.5em;
71 margin-bottom: 0.5em;
72}
73
74pre {
75 padding: 0;
76 margin: 0;
77}
78
79span#author {
80 color: #527bbd;
81 font-family: sans-serif;
82 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:3183 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:2384}
85span#email {
86}
87span#revision {
88 font-family: sans-serif;
89}
90
91div#footer {
92 font-family: sans-serif;
93 font-size: small;
94 border-top: 2px solid silver;
95 padding-top: 0.5em;
96 margin-top: 4.0em;
97}
98div#footer-text {
99 float: left;
100 padding-bottom: 0.5em;
101}
102div#footer-badges {
103 float: right;
104 padding-bottom: 0.5em;
105}
106
107div#preamble,
108div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
109div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
110div.admonitionblock {
111 margin-right: 10%;
112 margin-top: 1.5em;
113 margin-bottom: 1.5em;
114}
115div.admonitionblock {
116 margin-top: 2.5em;
117 margin-bottom: 2.5em;
118}
119
120div.content { /* Block element content. */
121 padding: 0;
122}
123
124/* Block element titles. */
125div.title, caption.title {
126 font-family: sans-serif;
127 font-weight: bold;
128 text-align: left;
129 margin-top: 1.0em;
130 margin-bottom: 0.5em;
131}
132div.title + * {
133 margin-top: 0;
134}
135
136td div.title:first-child {
137 margin-top: 0.0em;
138}
139div.content div.title:first-child {
140 margin-top: 0.0em;
141}
142div.content + div.title {
143 margin-top: 0.0em;
144}
145
146div.sidebarblock > div.content {
147 background: #ffffee;
148 border: 1px solid silver;
149 padding: 0.5em;
150}
151
Junio C Hamanoba4b9282008-07-06 05:20:31152div.listingblock {
153 margin-right: 0%;
154}
Junio C Hamano1a4e8412005-12-27 08:17:23155div.listingblock > div.content {
156 border: 1px solid silver;
157 background: #f4f4f4;
158 padding: 0.5em;
159}
160
161div.quoteblock > div.content {
162 padding-left: 2.0em;
163}
Junio C Hamanoba4b9282008-07-06 05:20:31164
165div.attribution {
Junio C Hamano1a4e8412005-12-27 08:17:23166 text-align: right;
167}
Junio C Hamanoba4b9282008-07-06 05:20:31168div.verseblock + div.attribution {
169 text-align: left;
170}
Junio C Hamano1a4e8412005-12-27 08:17:23171
172div.admonitionblock .icon {
173 vertical-align: top;
174 font-size: 1.1em;
175 font-weight: bold;
176 text-decoration: underline;
177 color: #527bbd;
178 padding-right: 0.5em;
179}
180div.admonitionblock td.content {
181 padding-left: 0.5em;
182 border-left: 2px solid silver;
183}
184
185div.exampleblock > div.content {
186 border-left: 2px solid silver;
187 padding: 0.5em;
188}
189
190div.verseblock div.content {
191 white-space: pre;
192}
193
194div.imageblock div.content { padding-left: 0; }
195div.imageblock img { border: 1px solid silver; }
196span.image img { border-style: none; }
197
198dl {
199 margin-top: 0.8em;
200 margin-bottom: 0.8em;
201}
202dt {
203 margin-top: 0.5em;
204 margin-bottom: 0;
205 font-style: italic;
206}
207dd > *:first-child {
208 margin-top: 0;
209}
210
211ul, ol {
212 list-style-position: outside;
213}
Junio C Hamanoba4b9282008-07-06 05:20:31214div.olist2 ol {
Junio C Hamano1a4e8412005-12-27 08:17:23215 list-style-type: lower-alpha;
216}
217
218div.tableblock > table {
Junio C Hamanoba4b9282008-07-06 05:20:31219 border: 3px solid #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23220}
221thead {
222 font-family: sans-serif;
223 font-weight: bold;
224}
225tfoot {
226 font-weight: bold;
227}
228
229div.hlist {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
232}
Junio C Hamanoba4b9282008-07-06 05:20:31233div.hlist td {
234 padding-bottom: 5px;
235}
Junio C Hamano1a4e8412005-12-27 08:17:23236td.hlist1 {
237 vertical-align: top;
238 font-style: italic;
239 padding-right: 0.8em;
240}
241td.hlist2 {
242 vertical-align: top;
243}
244
245@media print {
246 div#footer-badges { display: none; }
247}
Junio C Hamanoba4b9282008-07-06 05:20:31248
249div#toctitle {
250 color: #527bbd;
251 font-family: sans-serif;
252 font-size: 1.1em;
253 font-weight: bold;
254 margin-top: 1.0em;
255 margin-bottom: 0.1em;
256}
257
258div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
259 margin-top: 0;
260 margin-bottom: 0;
261}
262div.toclevel2 {
263 margin-left: 2em;
264 font-size: 0.9em;
265}
266div.toclevel3 {
267 margin-left: 4em;
268 font-size: 0.9em;
269}
270div.toclevel4 {
271 margin-left: 6em;
272 font-size: 0.9em;
273}
274include1::./stylesheets/xhtml11-manpage.css[]
Junio C Hamano1a4e8412005-12-27 08:17:23275/* Workarounds for IE6's broken and incomplete CSS2. */
276
277div.sidebar-content {
278 background: #ffffee;
279 border: 1px solid silver;
280 padding: 0.5em;
281}
282div.sidebar-title, div.image-title {
283 font-family: sans-serif;
284 font-weight: bold;
285 margin-top: 0.0em;
286 margin-bottom: 0.5em;
287}
288
289div.listingblock div.content {
290 border: 1px solid silver;
291 background: #f4f4f4;
292 padding: 0.5em;
293}
294
295div.quoteblock-content {
296 padding-left: 2.0em;
297}
298
299div.exampleblock-content {
300 border-left: 2px solid silver;
301 padding-left: 0.5em;
302}
Junio C Hamanoba4b9282008-07-06 05:20:31303
304/* IE6 sets dynamically generated links as visited. */
305div#toc a:visited { color: blue; }
Junio C Hamano1a4e8412005-12-27 08:17:23306</style>
307<title>git-format-patch(1)</title>
308</head>
309<body>
310<div id="header">
311<h1>
312git-format-patch(1) Manual Page
313</h1>
314<h2>NAME</h2>
315<div class="sectionbody">
316<p>git-format-patch -
Junio C Hamano01078922006-03-10 00:31:47317 Prepare patches for e-mail submission
Junio C Hamano1a4e8412005-12-27 08:17:23318</p>
319</div>
320</div>
321<h2>SYNOPSIS</h2>
322<div class="sectionbody">
Junio C Hamano235a91e2006-01-07 01:13:58323<div class="verseblock">
Junio C Hamanofce7c7e2008-07-02 03:06:38324<div class="content"><em>git format-patch</em> [-k] [-o &lt;dir&gt; | --stdout] [--thread]
Junio C Hamanoc51fede2007-03-12 07:29:20325 [--attach[=&lt;boundary&gt;] | --inline[=&lt;boundary&gt;]]
Junio C Hamano94cad1a2007-06-06 10:48:25326 [-s | --signoff] [&lt;common diff options&gt;]
Junio C Hamano8c5802d2007-11-15 00:13:36327 [-n | --numbered | -N | --no-numbered]
Junio C Hamano94cad1a2007-06-06 10:48:25328 [--start-number &lt;n&gt;] [--numbered-files]
Junio C Hamano4f9a6052007-01-17 20:25:16329 [--in-reply-to=Message-Id] [--suffix=.&lt;sfx&gt;]
Junio C Hamano7c73c662007-01-19 00:37:50330 [--ignore-if-in-upstream]
Junio C Hamano6f1cca82007-04-12 05:02:47331 [--subject-prefix=Subject-Prefix]
Junio C Hamano24bc09a2008-02-28 00:27:44332 [--cc=&lt;email&gt;]
333 [--cover-letter]
Junio C Hamano7d9e9bd2007-08-29 07:31:47334 [ &lt;since&gt; | &lt;revision range&gt; ]</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23335</div>
Junio C Hamanoba4b9282008-07-06 05:20:31336<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23337<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31338<div class="para"><p>Prepare each commit with its patch in
Junio C Hamano341071d2006-06-04 07:24:48339one file per commit, formatted to resemble UNIX mailbox format.
Junio C Hamano7d9e9bd2007-08-29 07:31:47340The output of this command is convenient for e-mail submission or
Junio C Hamanoba4b9282008-07-06 05:20:31341for use with <em>git-am</em>.</p></div>
342<div class="para"><p>There are two ways to specify which commits to operate on.</p></div>
343<div class="olist"><ol>
Junio C Hamano7d9e9bd2007-08-29 07:31:47344<li>
345<p>
346A single commit, &lt;since&gt;, specifies that the commits leading
347 to the tip of the current branch that are not in the history
348 that leads to the &lt;since&gt; to be output.
349</p>
350</li>
351<li>
352<p>
353Generic &lt;revision range&gt; expression (see "SPECIFYING
354 REVISIONS" section in <a href="git-rev-parse.html">git-rev-parse(1)</a>) means the
355 commits in the specified range.
356</p>
357</li>
Junio C Hamanoba4b9282008-07-06 05:20:31358</ol></div>
359<div class="para"><p>A single commit, when interpreted as a &lt;revision range&gt;
Junio C Hamano7d9e9bd2007-08-29 07:31:47360expression, means "everything that leads to that commit", but
361if you write <em>git format-patch &lt;commit&gt;</em>, the previous rule
362applies to that command line and you do not get "everything
363since the beginning of the time". If you want to format
364everything since project inception to one commit, say "git
365format-patch --root &lt;commit&gt;" to make it clear that it is the
Junio C Hamanoba4b9282008-07-06 05:20:31366latter case.</p></div>
367<div class="para"><p>By default, each output file is numbered sequentially from 1, and uses the
Junio C Hamano341071d2006-06-04 07:24:48368first line of the commit message (massaged for pathname safety) as
Junio C Hamano94cad1a2007-06-06 10:48:25369the filename. With the --numbered-files option, the output file names
370will only be numbers, without the first line of the commit appended.
371The names of the output files are printed to standard
Junio C Hamanoba4b9282008-07-06 05:20:31372output, unless the --stdout option is specified.</p></div>
373<div class="para"><p>If -o is specified, output files are created in &lt;dir&gt;. Otherwise
374they are created in the current working directory.</p></div>
375<div class="para"><p>If -n is specified, instead of "[PATCH] Subject", the first line
376is formatted as "[PATCH n/m] Subject".</p></div>
377<div class="para"><p>If given --thread, <em>git-format-patch</em> will generate In-Reply-To and
Junio C Hamanof9ca97d2006-07-25 22:23:09378References headers to make the second and subsequent patch mails appear
379as replies to the first mail; this also generates a Message-Id header to
Junio C Hamanoba4b9282008-07-06 05:20:31380reference.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23381</div>
Junio C Hamanoba4b9282008-07-06 05:20:31382<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23383<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31384<div class="vlist"><dl>
Junio C Hamano1a4e8412005-12-27 08:17:23385<dt>
Junio C Hamano60f8aa82007-03-06 09:58:26386-p
387</dt>
388<dd>
389<p>
Junio C Hamanoff979792007-11-16 10:11:30390 Generate patches without diffstat.
Junio C Hamano60f8aa82007-03-06 09:58:26391</p>
392</dd>
393<dt>
394-u
395</dt>
396<dd>
397<p>
398 Synonym for "-p".
399</p>
400</dd>
401<dt>
Junio C Hamano69361562007-07-26 02:14:34402-U&lt;n&gt;
403</dt>
404<dd>
405<p>
406 Shorthand for "--unified=&lt;n&gt;".
407</p>
408</dd>
409<dt>
410--unified=&lt;n&gt;
411</dt>
412<dd>
413<p>
414 Generate diffs with &lt;n&gt; lines of context instead of
415 the usual three. Implies "-p".
416</p>
417</dd>
418<dt>
Junio C Hamano60f8aa82007-03-06 09:58:26419--raw
420</dt>
421<dd>
422<p>
423 Generate the raw format.
Junio C Hamanoff979792007-11-16 10:11:30424
Junio C Hamano60f8aa82007-03-06 09:58:26425</p>
426</dd>
427<dt>
428--patch-with-raw
429</dt>
430<dd>
431<p>
432 Synonym for "-p --raw".
433</p>
434</dd>
435<dt>
436--stat[=width[,name-width]]
437</dt>
438<dd>
439<p>
440 Generate a diffstat. You can override the default
441 output width for 80-column terminal by "--stat=width".
442 The width of the filename part can be controlled by
443 giving another width to it separated by a comma.
444</p>
445</dd>
446<dt>
447--numstat
448</dt>
449<dd>
450<p>
451 Similar to --stat, but shows number of added and
452 deleted lines in decimal notation and pathname without
453 abbreviation, to make it more machine friendly. For
454 binary files, outputs two <tt>-</tt> instead of saying
455 <tt>0 0</tt>.
456</p>
457</dd>
458<dt>
459--shortstat
460</dt>
461<dd>
462<p>
463 Output only the last line of the --stat format containing total
464 number of modified files, as well as number of added and deleted
465 lines.
466</p>
467</dd>
468<dt>
Junio C Hamano6a45be92008-04-22 08:19:03469--dirstat[=limit]
470</dt>
471<dd>
472<p>
473 Output only the sub-directories that are impacted by a diff,
474 and to what degree they are impacted. You can override the
475 default cut-off in percent (3) by "--dirstat=limit". If you
476 want to enable "cumulative" directory statistics, you can use
477 the "--cumulative" flag, which adds up percentages recursively
478 even when they have been already reported for a sub-directory.
479</p>
480</dd>
481<dt>
Junio C Hamano60f8aa82007-03-06 09:58:26482--summary
483</dt>
484<dd>
485<p>
486 Output a condensed summary of extended header information
487 such as creations, renames and mode changes.
488</p>
489</dd>
490<dt>
491--patch-with-stat
492</dt>
493<dd>
494<p>
495 Synonym for "-p --stat".
Junio C Hamanoff979792007-11-16 10:11:30496 This is the default.
Junio C Hamano60f8aa82007-03-06 09:58:26497</p>
498</dd>
499<dt>
500-z
501</dt>
502<dd>
503<p>
Junio C Hamanob968dbb2007-07-27 07:26:40504 NUL-line termination on output. This affects the --raw
505 output field terminator. Also output from commands such
506 as "git-log" will be delimited with NUL between commits.
Junio C Hamano60f8aa82007-03-06 09:58:26507</p>
508</dd>
509<dt>
510--name-only
511</dt>
512<dd>
513<p>
514 Show only names of changed files.
515</p>
516</dd>
517<dt>
518--name-status
519</dt>
520<dd>
521<p>
Junio C Hamanoa9aee782008-04-23 16:09:20522 Show only names and status of changed files. See the description
523 of the <tt>--diff-filter</tt> option on what the status letters mean.
Junio C Hamano60f8aa82007-03-06 09:58:26524</p>
525</dd>
526<dt>
527--color
528</dt>
529<dd>
530<p>
531 Show colored diff.
532</p>
533</dd>
534<dt>
535--no-color
536</dt>
537<dd>
538<p>
539 Turn off colored diff, even when the configuration file
540 gives the default to color output.
541</p>
542</dd>
543<dt>
544--color-words
545</dt>
546<dd>
547<p>
548 Show colored word diff, i.e. color words which have changed.
549</p>
550</dd>
551<dt>
552--no-renames
553</dt>
554<dd>
555<p>
556 Turn off rename detection, even when the configuration
557 file gives the default to do so.
558</p>
559</dd>
560<dt>
561--check
562</dt>
563<dd>
564<p>
565 Warn if changes introduce trailing whitespace
Junio C Hamano3dac5042007-12-15 08:40:54566 or an indent that uses a space before a tab. Exits with
567 non-zero status if problems are found. Not compatible with
568 --exit-code.
Junio C Hamano60f8aa82007-03-06 09:58:26569</p>
570</dd>
571<dt>
572--full-index
573</dt>
574<dd>
575<p>
576 Instead of the first handful characters, show full
577 object name of pre- and post-image blob on the "index"
578 line when generating a patch format output.
579</p>
580</dd>
581<dt>
582--binary
583</dt>
584<dd>
585<p>
586 In addition to --full-index, output "binary diff" that
587 can be applied with "git apply".
588</p>
589</dd>
590<dt>
591--abbrev[=&lt;n&gt;]
592</dt>
593<dd>
594<p>
595 Instead of showing the full 40-byte hexadecimal object
596 name in diff-raw format output and diff-tree header
597 lines, show only handful hexdigits prefix. This is
598 independent of --full-index option above, which controls
599 the diff-patch output format. Non default number of
600 digits can be specified with --abbrev=&lt;n&gt;.
601</p>
602</dd>
603<dt>
604-B
605</dt>
606<dd>
607<p>
608 Break complete rewrite changes into pairs of delete and create.
609</p>
610</dd>
611<dt>
612-M
613</dt>
614<dd>
615<p>
616 Detect renames.
617</p>
618</dd>
619<dt>
620-C
621</dt>
622<dd>
623<p>
Junio C Hamano16f98872007-06-12 16:09:14624 Detect copies as well as renames. See also <tt>--find-copies-harder</tt>.
Junio C Hamano60f8aa82007-03-06 09:58:26625</p>
626</dd>
627<dt>
628--diff-filter=[ACDMRTUXB*]
629</dt>
630<dd>
631<p>
632 Select only files that are Added (<tt>A</tt>), Copied (<tt>C</tt>),
633 Deleted (<tt>D</tt>), Modified (<tt>M</tt>), Renamed (<tt>R</tt>), have their
634 type (mode) changed (<tt>T</tt>), are Unmerged (<tt>U</tt>), are
635 Unknown (<tt>X</tt>), or have had their pairing Broken (<tt>B</tt>).
636 Any combination of the filter characters may be used.
637 When <tt>*</tt> (All-or-none) is added to the combination, all
638 paths are selected if there is any file that matches
639 other criteria in the comparison; if there is no file
640 that matches other criteria, nothing is selected.
641</p>
642</dd>
643<dt>
644--find-copies-harder
645</dt>
646<dd>
647<p>
Junio C Hamano16f98872007-06-12 16:09:14648 For performance reasons, by default, <tt>-C</tt> option finds copies only
Junio C Hamano60f8aa82007-03-06 09:58:26649 if the original file of the copy was modified in the same
650 changeset. This flag makes the command
651 inspect unmodified files as candidates for the source of
652 copy. This is a very expensive operation for large
Junio C Hamano16f98872007-06-12 16:09:14653 projects, so use it with caution. Giving more than one
654 <tt>-C</tt> option has the same effect.
Junio C Hamano60f8aa82007-03-06 09:58:26655</p>
656</dd>
657<dt>
658-l&lt;num&gt;
659</dt>
660<dd>
661<p>
662 -M and -C options require O(n^2) processing time where n
663 is the number of potential rename/copy targets. This
664 option prevents rename/copy detection from running if
665 the number of rename/copy targets exceeds the specified
666 number.
667</p>
668</dd>
669<dt>
670-S&lt;string&gt;
671</dt>
672<dd>
673<p>
674 Look for differences that contain the change in &lt;string&gt;.
675</p>
676</dd>
677<dt>
678--pickaxe-all
679</dt>
680<dd>
681<p>
682 When -S finds a change, show all the changes in that
683 changeset, not just the files that contain the change
684 in &lt;string&gt;.
685</p>
686</dd>
687<dt>
688--pickaxe-regex
689</dt>
690<dd>
691<p>
692 Make the &lt;string&gt; not a plain string but an extended POSIX
693 regex to match.
694</p>
695</dd>
696<dt>
697-O&lt;orderfile&gt;
698</dt>
699<dd>
700<p>
701 Output the patch in the order specified in the
702 &lt;orderfile&gt;, which has one shell glob pattern per line.
703</p>
704</dd>
705<dt>
706-R
707</dt>
708<dd>
709<p>
710 Swap two inputs; that is, show differences from index or
711 on-disk file to tree contents.
712</p>
713</dd>
714<dt>
Junio C Hamano24bc09a2008-02-28 00:27:44715--relative[=&lt;path&gt;]
716</dt>
717<dd>
718<p>
719 When run from a subdirectory of the project, it can be
720 told to exclude changes outside the directory and show
721 pathnames relative to it with this option. When you are
722 not in a subdirectory (e.g. in a bare repository), you
723 can name which subdirectory to make the output relative
724 to by giving a &lt;path&gt; as an argument.
725</p>
726</dd>
727<dt>
Junio C Hamano60f8aa82007-03-06 09:58:26728--text
729</dt>
730<dd>
731<p>
732 Treat all files as text.
733</p>
734</dd>
735<dt>
736-a
737</dt>
738<dd>
739<p>
740 Shorthand for "--text".
741</p>
742</dd>
743<dt>
744--ignore-space-at-eol
745</dt>
746<dd>
747<p>
Junio C Hamano3a702342007-12-12 21:34:02748 Ignore changes in whitespace at EOL.
Junio C Hamano60f8aa82007-03-06 09:58:26749</p>
750</dd>
751<dt>
752--ignore-space-change
753</dt>
754<dd>
755<p>
Junio C Hamano3a702342007-12-12 21:34:02756 Ignore changes in amount of whitespace. This ignores whitespace
757 at line end, and considers all other sequences of one or
758 more whitespace characters to be equivalent.
Junio C Hamano60f8aa82007-03-06 09:58:26759</p>
760</dd>
761<dt>
762-b
763</dt>
764<dd>
765<p>
766 Shorthand for "--ignore-space-change".
767</p>
768</dd>
769<dt>
770--ignore-all-space
771</dt>
772<dd>
773<p>
Junio C Hamano3a702342007-12-12 21:34:02774 Ignore whitespace when comparing lines. This ignores
775 differences even if one line has whitespace where the other
Junio C Hamano60f8aa82007-03-06 09:58:26776 line has none.
777</p>
778</dd>
779<dt>
780-w
781</dt>
782<dd>
783<p>
784 Shorthand for "--ignore-all-space".
785</p>
786</dd>
Junio C Hamano48fd2f62007-03-19 02:02:30787<dt>
788--exit-code
789</dt>
790<dd>
791<p>
792 Make the program exit with codes similar to diff(1).
793 That is, it exits with 1 if there were differences and
794 0 means no differences.
795</p>
796</dd>
Junio C Hamano35e57552007-03-25 07:54:35797<dt>
798--quiet
799</dt>
800<dd>
801<p>
802 Disable all output of the program. Implies --exit-code.
803</p>
804</dd>
Junio C Hamanobb0f4042007-07-04 06:41:40805<dt>
806--ext-diff
807</dt>
808<dd>
809<p>
810 Allow an external diff helper to be executed. If you set an
Junio C Hamano1b50ce92007-10-03 12:05:53811 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
812 to use this option with <a href="git-log.html">git-log(1)</a> and friends.
Junio C Hamanobb0f4042007-07-04 06:41:40813</p>
814</dd>
815<dt>
816--no-ext-diff
817</dt>
818<dd>
819<p>
820 Disallow external diff drivers.
821</p>
822</dd>
Junio C Hamanoe27cbd22007-12-21 17:57:33823<dt>
Junio C Hamanodfccbb02008-05-26 01:16:14824--ignore-submodules
825</dt>
826<dd>
827<p>
828 Ignore changes to submodules in the diff generation.
829</p>
830</dd>
831<dt>
Junio C Hamanoe27cbd22007-12-21 17:57:33832--src-prefix=&lt;prefix&gt;
833</dt>
834<dd>
835<p>
836 Show the given source prefix instead of "a/".
837</p>
838</dd>
839<dt>
840--dst-prefix=&lt;prefix&gt;
841</dt>
842<dd>
843<p>
844 Show the given destination prefix instead of "b/".
845</p>
846</dd>
847<dt>
848--no-prefix
849</dt>
850<dd>
851<p>
852 Do not show any source or destination prefix.
853</p>
854</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31855</dl></div>
856<div class="para"><p>For more detailed explanation on these common options, see also
857<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div>
858<div class="vlist"><dl>
Junio C Hamano60f8aa82007-03-06 09:58:26859<dt>
Junio C Hamanobb0f4042007-07-04 06:41:40860-&lt;n&gt;
861</dt>
862<dd>
863<p>
864 Limits the number of patches to prepare.
865</p>
866</dd>
867<dt>
Junio C Hamanoeb415992008-06-08 22:49:47868-o &lt;dir&gt;
869</dt>
870<dt>
871--output-directory &lt;dir&gt;
Junio C Hamano1a4e8412005-12-27 08:17:23872</dt>
873<dd>
874<p>
875 Use &lt;dir&gt; to store the resulting files, instead of the
Junio C Hamano1bab4b02006-06-06 21:58:33876 current working directory.
Junio C Hamano1a4e8412005-12-27 08:17:23877</p>
878</dd>
879<dt>
Junio C Hamanoeb415992008-06-08 22:49:47880-n
881</dt>
882<dt>
883--numbered
Junio C Hamano1a4e8412005-12-27 08:17:23884</dt>
885<dd>
886<p>
887 Name output in <em>[PATCH n/m]</em> format.
888</p>
889</dd>
890<dt>
Junio C Hamanoeb415992008-06-08 22:49:47891-N
892</dt>
893<dt>
894--no-numbered
Junio C Hamano8c5802d2007-11-15 00:13:36895</dt>
896<dd>
897<p>
898 Name output in <em>[PATCH]</em> format.
899</p>
900</dd>
901<dt>
Junio C Hamano341071d2006-06-04 07:24:48902--start-number &lt;n&gt;
903</dt>
904<dd>
905<p>
906 Start numbering the patches at &lt;n&gt; instead of 1.
907</p>
908</dd>
909<dt>
Junio C Hamano94cad1a2007-06-06 10:48:25910--numbered-files
911</dt>
912<dd>
913<p>
914 Output file names will be a simple number sequence
915 without the default first line of the commit appended.
916 Mutually exclusive with the --stdout option.
917</p>
918</dd>
919<dt>
Junio C Hamanoeb415992008-06-08 22:49:47920-k
921</dt>
922<dt>
923--keep-subject
Junio C Hamano1a4e8412005-12-27 08:17:23924</dt>
925<dd>
926<p>
927 Do not strip/add <em>[PATCH]</em> from the first line of the
928 commit log message.
929</p>
930</dd>
931<dt>
Junio C Hamanoeb415992008-06-08 22:49:47932-s
933</dt>
934<dt>
935--signoff
Junio C Hamano1a4e8412005-12-27 08:17:23936</dt>
937<dd>
938<p>
939 Add <tt>Signed-off-by:</tt> line to the commit message, using
940 the committer identity of yourself.
941</p>
942</dd>
943<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23944--stdout
945</dt>
946<dd>
947<p>
Junio C Hamano341071d2006-06-04 07:24:48948 Print all commits to the standard output in mbox format,
949 instead of creating a file for each one.
Junio C Hamano1a4e8412005-12-27 08:17:23950</p>
951</dd>
Junio C Hamano2496ae42006-03-11 08:04:33952<dt>
Junio C Hamanoc51fede2007-03-12 07:29:20953--attach[=&lt;boundary&gt;]
Junio C Hamano2496ae42006-03-11 08:04:33954</dt>
955<dd>
956<p>
Junio C Hamanoc51fede2007-03-12 07:29:20957 Create multipart/mixed attachment, the first part of
958 which is the commit message and the patch itself in the
959 second part, with "Content-Disposition: attachment".
960</p>
961</dd>
962<dt>
963--inline[=&lt;boundary&gt;]
964</dt>
965<dd>
966<p>
967 Create multipart/mixed attachment, the first part of
968 which is the commit message and the patch itself in the
969 second part, with "Content-Disposition: inline".
Junio C Hamano2496ae42006-03-11 08:04:33970</p>
971</dd>
Junio C Hamanof9ca97d2006-07-25 22:23:09972<dt>
973--thread
974</dt>
975<dd>
976<p>
977 Add In-Reply-To and References headers to make the second and
978 subsequent mails appear as replies to the first. Also generates
979 the Message-Id header to reference.
980</p>
981</dd>
982<dt>
983--in-reply-to=Message-Id
984</dt>
985<dd>
986<p>
987 Make the first mail (or all the mails with --no-thread) appear as a
988 reply to the given Message-Id, which avoids breaking threads to
989 provide a new patch series.
990</p>
991</dd>
Junio C Hamano4f9a6052007-01-17 20:25:16992<dt>
Junio C Hamano7c73c662007-01-19 00:37:50993--ignore-if-in-upstream
994</dt>
995<dd>
996<p>
997 Do not include a patch that matches a commit in
998 &lt;until&gt;..&lt;since&gt;. This will examine all patches reachable
999 from &lt;since&gt; but not from &lt;until&gt; and compare them with the
1000 patches being generated, and any patch that matches is
1001 ignored.
1002</p>
1003</dd>
1004<dt>
Junio C Hamano6f1cca82007-04-12 05:02:471005--subject-prefix=&lt;Subject-Prefix&gt;
1006</dt>
1007<dd>
1008<p>
1009 Instead of the standard <em>[PATCH]</em> prefix in the subject
1010 line, instead use <em>[&lt;Subject-Prefix&gt;]</em>. This
1011 allows for useful naming of a patch series, and can be
1012 combined with the --numbered option.
1013</p>
1014</dd>
1015<dt>
Junio C Hamano24bc09a2008-02-28 00:27:441016--cc=&lt;email&gt;
1017</dt>
1018<dd>
1019<p>
1020 Add a "Cc:" header to the email headers. This is in addition
1021 to any configured headers, and may be used multiple times.
1022</p>
1023</dd>
1024<dt>
1025--cover-letter
1026</dt>
1027<dd>
1028<p>
1029 Generate a cover letter template. You still have to fill in
1030 a description, but the shortlog and the diffstat will be
1031 generated for you.
1032</p>
1033</dd>
1034<dt>
Junio C Hamano4f9a6052007-01-17 20:25:161035--suffix=.&lt;sfx&gt;
1036</dt>
1037<dd>
1038<p>
Junio C Hamano7c73c662007-01-19 00:37:501039 Instead of using <tt>.patch</tt> as the suffix for generated
Junio C Hamanoa6387422007-08-25 03:54:271040 filenames, use specified suffix. A common alternative is
Junio C Hamano7c73c662007-01-19 00:37:501041 <tt>--suffix=.txt</tt>.
Junio C Hamano4f9a6052007-01-17 20:25:161042</p>
Junio C Hamanoba4b9282008-07-06 05:20:311043<div class="para"><p>Note that you would need to include the leading dot <tt>.</tt> if you
Junio C Hamano4f9a6052007-01-17 20:25:161044want a filename like <tt>0001-description-of-my-change.patch</tt>, and
1045the first letter does not have to be a dot. Leaving it empty would
Junio C Hamanoba4b9282008-07-06 05:20:311046not add any suffix.</p></div>
Junio C Hamano4f9a6052007-01-17 20:25:161047</dd>
Junio C Hamano869bb802008-05-12 00:29:471048<dt>
1049--no-binary
1050</dt>
1051<dd>
1052<p>
1053 Don't output contents of changes in binary files, just take note
1054 that they differ. Note that this disable the patch to be properly
1055 applied. By default the contents of changes in those files are
1056 encoded in the patch.
1057</p>
1058</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311059</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:231060</div>
Junio C Hamanoba4b9282008-07-06 05:20:311061<h2 id="_configuration">CONFIGURATION</h2>
Junio C Hamano2496ae42006-03-11 08:04:331062<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311063<div class="para"><p>You can specify extra mail header lines to be added to each message
Junio C Hamano8c5802d2007-11-15 00:13:361064in the repository configuration, new defaults for the subject prefix
Junio C Hamanoba4b9282008-07-06 05:20:311065and file suffix, and number patches when outputting more than one.</p></div>
Junio C Hamano7c73c662007-01-19 00:37:501066<div class="listingblock">
Junio C Hamano2496ae42006-03-11 08:04:331067<div class="content">
Junio C Hamano7c73c662007-01-19 00:37:501068<pre><tt>[format]
1069 headers = "Organization: git-foo\n"
Junio C Hamano1d90cb02007-07-03 07:05:311070 subjectprefix = CHANGE
Junio C Hamano8c5802d2007-11-15 00:13:361071 suffix = .txt
Junio C Hamano2fbcd212008-05-14 22:26:071072 numbered = auto
1073 cc = &lt;email&gt;</tt></pre>
Junio C Hamano4f9a6052007-01-17 20:25:161074</div></div>
Junio C Hamano2496ae42006-03-11 08:04:331075</div>
Junio C Hamanoba4b9282008-07-06 05:20:311076<h2 id="_examples">EXAMPLES</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231077<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311078<div class="ilist"><ul>
Junio C Hamano6d76d612008-05-09 05:46:081079<li>
Junio C Hamano1a4e8412005-12-27 08:17:231080<p>
Junio C Hamano6d76d612008-05-09 05:46:081081Extract commits between revisions R1 and R2, and apply them on top of
Junio C Hamanoba4b9282008-07-06 05:20:311082the current branch using <em>git-am</em> to cherry-pick them:
Junio C Hamano1a4e8412005-12-27 08:17:231083</p>
Junio C Hamano6d76d612008-05-09 05:46:081084<div class="listingblock">
1085<div class="content">
Junio C Hamanoba4b9282008-07-06 05:20:311086<pre><tt>$ git format-patch -k --stdout R1..R2 | git am -3 -k</tt></pre>
Junio C Hamano6d76d612008-05-09 05:46:081087</div></div>
1088</li>
1089<li>
Junio C Hamano1a4e8412005-12-27 08:17:231090<p>
Junio C Hamano6d76d612008-05-09 05:46:081091Extract all commits which are in the current branch but not in the
1092origin branch:
Junio C Hamano1a4e8412005-12-27 08:17:231093</p>
Junio C Hamano6d76d612008-05-09 05:46:081094<div class="listingblock">
1095<div class="content">
1096<pre><tt>$ git format-patch origin</tt></pre>
1097</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311098<div class="para"><p>For each commit a separate file is created in the current directory.</p></div>
Junio C Hamano6d76d612008-05-09 05:46:081099</li>
1100<li>
Junio C Hamano7d9e9bd2007-08-29 07:31:471101<p>
Junio C Hamano6d76d612008-05-09 05:46:081102Extract all commits that lead to <em>origin</em> since the inception of the
1103project:
Junio C Hamano7d9e9bd2007-08-29 07:31:471104</p>
Junio C Hamano6d76d612008-05-09 05:46:081105<div class="listingblock">
1106<div class="content">
Junio C Hamanoba4b9282008-07-06 05:20:311107<pre><tt>$ git format-patch --root origin</tt></pre>
Junio C Hamano6d76d612008-05-09 05:46:081108</div></div>
1109</li>
1110<li>
Junio C Hamano1a4e8412005-12-27 08:17:231111<p>
Junio C Hamano6d76d612008-05-09 05:46:081112The same as the previous one:
Junio C Hamano1a4e8412005-12-27 08:17:231113</p>
Junio C Hamano6d76d612008-05-09 05:46:081114<div class="listingblock">
1115<div class="content">
1116<pre><tt>$ git format-patch -M -B origin</tt></pre>
1117</div></div>
Junio C Hamanoba4b9282008-07-06 05:20:311118<div class="para"><p>Additionally, it detects and handles renames and complete rewrites
Junio C Hamano6d76d612008-05-09 05:46:081119intelligently to produce a renaming patch. A renaming patch reduces
1120the amount of text output, and generally makes it easier to review it.
1121Note that the "patch" program does not understand renaming patches, so
Junio C Hamanoba4b9282008-07-06 05:20:311122use it only when you know the recipient uses git to apply your patch.</p></div>
Junio C Hamano6d76d612008-05-09 05:46:081123</li>
1124<li>
Junio C Hamano7c73c662007-01-19 00:37:501125<p>
Junio C Hamano6d76d612008-05-09 05:46:081126Extract three topmost commits from the current branch and format them
1127as e-mailable patches:
Junio C Hamano7c73c662007-01-19 00:37:501128</p>
Junio C Hamano6d76d612008-05-09 05:46:081129<div class="listingblock">
1130<div class="content">
1131<pre><tt>$ git format-patch -3</tt></pre>
1132</div></div>
1133</li>
Junio C Hamanoba4b9282008-07-06 05:20:311134</ul></div>
Junio C Hamano1a4e8412005-12-27 08:17:231135</div>
Junio C Hamanoba4b9282008-07-06 05:20:311136<h2 id="_see_also">SEE ALSO</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231137<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311138<div class="para"><p><a href="git-am.html">git-am(1)</a>, <a href="git-send-email.html">git-send-email(1)</a></p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231139</div>
Junio C Hamanoba4b9282008-07-06 05:20:311140<h2 id="_author">Author</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231141<div class="sectionbody">
Junio C Hamano0868a302008-07-22 09:20:441142<div class="para"><p>Written by Junio C Hamano &lt;gitster@pobox.com&gt;</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231143</div>
Junio C Hamanoba4b9282008-07-06 05:20:311144<h2 id="_documentation">Documentation</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231145<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311146<div class="para"><p>Documentation by Junio C Hamano and the git-list &lt;git@vger.kernel.org&gt;.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231147</div>
Junio C Hamanoba4b9282008-07-06 05:20:311148<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231149<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:311150<div class="para"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231151</div>
1152<div id="footer">
1153<div id="footer-text">
Junio C Hamano0868a302008-07-22 09:20:441154Last updated 2008-07-22 09:19:09 UTC
Junio C Hamano1a4e8412005-12-27 08:17:231155</div>
1156</div>
1157</body>
1158</html>